/* eslint-disable jsx-a11y/alt-text */
import React, { Suspense } from 'react'
import { Provider } from 'react-redux'
import { store } from '../store/store'
import { BrowserRouter, useRoutes } from 'react-router-dom'

import Layout from '../Layout'
import Npro from '../Loading/index'
import routers from './routers'
const Index = () => {
  const App = () => useRoutes(routers)
  return (
    <BrowserRouter>
      <Suspense
        fallback={
          <Layout>
            <Npro></Npro>
          </Layout>
        }
      >
        <Provider store={store}>
          <App />
        </Provider>
      </Suspense>
    </BrowserRouter>
  )
}

export default Index
